﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Common.Mail
{
    public class MailSenderSettingsHelper
    {
        public static MailSenderSettings GetMailSettings()
        {
            return new MailSenderSettings
            {
                FromAddress = ConfigurationManager.AppSettings["SmtpFromAddress"],
                FromAddressName = ConfigurationManager.AppSettings["SmtpFromAddressName"],
                SmtpHost = ConfigurationManager.AppSettings["SmtpHost"],
                SmtpLogin = ConfigurationManager.AppSettings["SmtpLogin"],
                SmtpPassword = ConfigurationManager.AppSettings["SmtpPassword"],
                SmtpPort = Convert.ToInt32(ConfigurationManager.AppSettings["SmtpPort"]),
                EnableSSL = Convert.ToBoolean(ConfigurationManager.AppSettings["SmtpEnableSSL"]),
                MailSignature = ConfigurationManager.AppSettings["MailSignature"]
            };
        }
    }
}
